-
Notifications
You must be signed in to change notification settings - Fork 1
feat: signup form functionality update #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the signup form by moving authentication logic from the parent page component into the SignupForm component itself. This change makes the SignupForm self-contained and directly handles user registration and navigation.
Key changes:
- Moved
authClient.signUp.email()logic from the page component into SignupForm'sonSubmithandler - Removed the
handleSignupprop from SignupForm interface, making it self-sufficient - Added router-based navigation on successful signup
- Removed the 'use client' directive from the page component (no longer needed since it doesn't use client-side hooks)
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| apps/client/src/components/sections/authentications/default/SignupForm.tsx | Internalized signup logic, added router navigation, reorganized imports, and updated Button props formatting |
| apps/client/src/app/auth/signup/page.tsx | Simplified to a presentational component by removing client-side logic and the handleSignup function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (signupData) { | ||
| router.push(rootPaths.root); | ||
| } | ||
| if (error) { | ||
| setError('root.credential', { type: 'manual', message: error.message }); |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both success and error conditions can be true simultaneously if signupData exists but error is also present. These should be mutually exclusive using else-if logic to prevent navigating away while also setting an error.
| if (signupData) { | |
| router.push(rootPaths.root); | |
| } | |
| if (error) { | |
| setError('root.credential', { type: 'manual', message: error.message }); | |
| if (error) { | |
| setError('root.credential', { type: 'manual', message: error.message }); | |
| } else if (signupData) { | |
| router.push(rootPaths.root); |
| router.push(rootPaths.root); | ||
| } | ||
| if (error) { | ||
| setError('root.credential', { type: 'manual', message: error.message }); |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential null reference error if error.message is undefined. The error object should be checked for the existence of the message property before accessing it, or provide a fallback error message.
| setError('root.credential', { type: 'manual', message: error.message }); | |
| setError('root.credential', { type: 'manual', message: error?.message ?? "An unknown error occurred." }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Changes
How to test
Screenshots (if UI)
Checklist